<include file="public/shop_header"/>

<body>

<!--main-->
<style type="text/css">
body{ background:#f4f4f4;}
</style>
<div class="cpMain">
  <div class="porder-tab clearfix">
    <a href="javascript:;" class="active" data-id=""> <i class="icon"> <img src="__PUBLIC__/shop/images/porder-i1.png" class="img-show"> <img src="__PUBLIC__/shop/images/porder-i1h.png" class="img-hide"> </i>
      <p class="tit">全部</p></a>

    <a href="javascript:;" data-id="0" > <i class="icon"> <img src="__PUBLIC__/shop/images/porder-i2.png" class="img-show"> <img src="__PUBLIC__/shop/images/porder-i2h.png" class="img-hide"> </i><p class="tit">待付款</p><if condition="$count.status_1 neq 0"><span class="num">{$count.status_1}</span></if></a>

    <a href="javascript:;" data-id="1" > <i class="icon"> <img src="__PUBLIC__/shop/images/porder-i3.png" class="img-show"> <img src="__PUBLIC__/shop/images/porder-i3h.png" class="img-hide"> </i><p class="tit">待发货</p><if condition="$count.status_2 neq 0"><span class="num">{$count.status_2}</span></if></a>

    <a href="javascript:;" data-id="2" > <i class="icon"> <img src="__PUBLIC__/shop/images/porder-i4.png" class="img-show"> <img src="__PUBLIC__/shop/images/porder-i4h.png" class="img-hide"> </i><p class="tit">待收货</p><if condition="$count.status_3 neq 0"><span class="num">{$count.status_3}</span></if></a>

    <a href="javascript:;" data-id="3" > <i class="icon"> <img src="__PUBLIC__/shop/images/porder-i5.png" class="img-show"> <img src="__PUBLIC__/shop/images/porder-i5h.png" class="img-hide"> </i><p class="tit">已完成</p></a>
  </div>

  <div id="ajax_return"></div>



</div>

<include file="public/shop_footer"/>
<!--main End-->

<script>
    $(document).ready(function(){
        var id = $(".porder-tab").find(".active").attr('data-id');
        $.ajax({
            type : "POST",
            url:"/index.php?m=home&c=Order&a=ajax_shop_index",//+tab,
            data:{id:id},
            success: function(data){
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    });

    $(function () {
        $(".porder-tab a").each(function(){
            $(this).click(function () {
                $(this).addClass('active').siblings('a').removeClass('active');
                var id = $(".porder-tab").find(".active").attr('data-id');
                $.ajax({
                    type : "POST",
                    url:"/index.php?m=home&c=Order&a=ajax_shop_index",//+tab,
                    data:{id:id},
                    success: function(data){
                        $("#ajax_return").html('');
                        $("#ajax_return").append(data);
                        $(".porder-tab a").removeClass('active');
                        $("[data-id='" + id + "']").addClass('active');
                    }
                });
            })
        });
    })
</script>


</body>
</html>
